# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

_realname=Sub-Exporter
pkgname=perl-${_realname}
pkgver=0.987
pkgrel=1
pkgdesc="A sophisticated exporter for custom-built routines"
arch=('any')
url="https://metacpan.org/release/Sub-Exporter"
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-Data-OptList' 'perl-Params-Util' 'perl-Sub-Install')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Sub-Exporter-${pkgver}.tar.gz)
sha512sums=('6b682d27a0df8ce971ea48aeca5162e1c70929c51cf27119b30361477876b0b86ecb15ab13a6c3cbe5bb85be9e600589fb9e3c9c4e94bad3fc05b675d293adad')

prepare() {
  cd ${_realname}-${pkgver}
}

build() {
  cd ${_realname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 \
  PERL_AUTOINSTALL=--skipdeps \
  PERL5LIB="" \
  MODULEBUILDRC=/dev/null \
  PERL_MM_OPT="INSTALLDIRS=vendor" \
  PERL_MB_OPT="--installdirs vendor" \
  perl Makefile.PL
  make
}

package() {
  cd ${_realname}-${pkgver}
  make install DESTDIR="${pkgdir}"
}
